<!--学员成绩录入-->
<template>
  <div class="assessment-container" style="width:100%">
    <div class="search-container" style="margin:0">
      <div class="search-container-left">
        <div class="search-container-item">
          <span>学期：</span>
          <el-select
            v-model="termid"
            style="width: 100px"
            size="mini"
            clearable
            placeholder="请选择"
          >
          <!-- @clear="scorequery" -->
            <el-option
              v-for="(item,index) in xqList"
              :key="index"
              :label="item.xqmc"
              :value="item.xqmc"
            >
            </el-option>
          </el-select>
        </div>
        <div class="search-container-item" v-if="roleId === '1490859421955674114'">
          <span>课程负责单位：</span>
          <el-select
            v-model="xb"
            style="width: 100px;margin-right:5px"
            size="mini"
            placeholder="请选择"
            @change="handleXb"
            clearable
          >
            <el-option
             style="margin-right:5px"
              v-for="(item,index) in xbList"
              :key="index"
              :label="item.deptName"
              :value="item.deptName"
            >
            </el-option>
          </el-select>
          <el-select
            v-model="gClass"
            style="width: 100px"
            size="mini"
            placeholder="请选择"
            @change="handleClass"
            clearable
          >
            <el-option
              v-for="(item,index) in gClassList"
              :key="index"
              :label="item.deptName ? item.deptName : item.value"
              :value="item.deptName ? item.deptName : item.value"
            >
            </el-option>
          </el-select>
        </div>
        <div class="search-container-item">
          <span>培养层次：</span>
          <el-select
              v-model="eduLevel"
              size="mini"
              style="width: 110px"
              placeholder="请选择"
              clearable
            >
            <el-option
              v-for="item in levelList"
              :key="item.dictKey"
              :label="item.dictValue"
              :value="item.id"
            >
            </el-option>
          </el-select>
        </div>
        <div class="search-container-item">
          <span>年级：</span>
          <el-select
            v-model="grade"
            style="width: 90px"
            size="mini"
            placeholder="请选择"
            clearable
          >
            <el-option
              v-for="(item,index) in njList"
              :key="index"
              :label="item.xqszxn"
              :value="item.xqszxn"
            >
            </el-option>
          </el-select>
        </div>
        <div class="search-container-item">
          <span>修习类型：</span>
          <el-select
            v-model="studytype"
            style="width: 83px"
            size="mini"
            placeholder="请选择"
            clearable
          >
            <el-option
              v-for="item in xxlxList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </div>
        <div class="search-container-item" v-if="roleId != '1475294432243830786'">
          <!-- 教员不显示 -->
          <span>授课教员：</span>
          <el-input
            style="width: 120px"
            size="mini"
            placeholder="请输入内容"
            v-model="teachingfaculty"
            clearable
          ></el-input>
        </div>
        <div class="search-container-item">
          <span>课程名称：</span>
          <el-input
            style="width: 120px"
            size="mini"
            placeholder="请输入内容"
            v-model="coursename"
            clearable
          ></el-input>
        </div>
        <div class="search-button" @click="scorequery" style="margin: 2px 0 0 0;">
          <img src="../../../assets/assessment/icon-search.png" alt="" />
          <span>查 询</span>
        </div>
      </div>
    </div>
    <div class="search-container-right" style="display:flex;margin-top:15px">
      <div class="import-button" style="width:160px" @click="toMakeScore">
        <img src="../../../assets/assessment/icon-import.png" alt="" />
        <span>录入补缓考成绩</span>
      </div>
      <div
        v-if="roleId === '1490859421955674114'"
        class="import-button"
        tyle="width:230px"
        @click="toMakeTwoScore"
      >
        <img src="../../../assets/assessment/icon-import.png" alt="" />
        <span>录入第二次补缓考成绩</span>
      </div>
    </div>
    <div class="plan-entry-table-container">
      <el-table
        :data="tableData"
        style="width: 100%"
        class="xpaas-table-class"
        row-class-name="xpaas-row-class"
        cell-class-name="xpaas-cell-class"
        header-row-class-name="xpaas-header-row-class"
        header-cell-class-name="xpaas-header-cell-class"
        @selection-change="handleSelectionChange"
      >
        <el-table-column width="70" align="center" type="selection">
        </el-table-column>
        <el-table-column
          prop="lrcj"
          label="录入成绩"
          width="134"
          align="center"
          class-name=""
          label-class-name=""
        >
          <template slot-scope="scope">
            <div class="lucj-import-button">
              <img src="../../../assets/assessment/icon-plan-record-detail.png" alt="" />
              <span @click="toMakeupScoreEntry(scope.row.planid)"
                >手动录入</span
              >
            </div>
            <div class="lucj-import-button" @click="lucjClick(scope.$index)">
              <img src="../../../assets/assessment/lrcj-import.png" alt="" />
              <span>模板导入</span>
            </div>
          </template>
        </el-table-column>
        <el-table-column
          prop="dccjd"
          label="导出成绩单"
          width="112"
          align="center"
        >
          <template slot-scope="scope">
            <!-- @click="showExportReportDialogags = true"-->
            <div class="lucj-expot-button" @click="save(scope.$index)">
              <img src="../../../assets/assessment/icon-export.png" alt="" />
              <span>分项</span>
            </div>
            <!-- @click="showExportReportDialog = true"-->
            <div class="lucj-expot-button" @click="savezong(scope.$index)">
              <img src="../../../assets/assessment/icon-export.png" alt="" />
              <span>总评</span>
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="termid" label="学期" align="center">
        </el-table-column>
        <el-table-column
          prop="teachingandresearchsection"
          label="教研室"
          align="center"
        >
        </el-table-column>
        <el-table-column prop="coursenumber" align="center" width="150">
          <template slot-scope="scope" slot="header">
            <div style="line-height: 20px;">课程编号</div>
            <div style="line-height: 20px;">【课程名称】</div>
          </template>
          <template slot-scope="scope">
            <div>{{ scope.row.coursenumber }}</div>
            <div>{{ scope.row.coursename }}</div>
          </template>
        </el-table-column>
        <el-table-column prop="grade" label="年级" align="center">
        </el-table-column>
        <el-table-column
          prop="classes"
          label="教学班"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="professionaldivisions"
          label="专业班次"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="teachingfaculty"
          label="授课教员"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="shouldrecord"
          label="应录"
          align="center"
        >
        </el-table-column>
        <el-table-column prop="ktwork" align="center" width="130">
          <template slot-scope="scope" slot="header">
            <div style="line-height: 20px;">课下作业</div>
            <div style="line-height: 20px;">(已录/已审)</div>
          </template>
        </el-table-column>
        <el-table-column prop="ktreview" align="center" width="130">
          <template slot-scope="scope" slot="header">
            <div style="line-height: 20px;">课下测评</div>
            <div style="line-height: 20px;">(已录/已审)</div>
          </template>
        </el-table-column>
        <el-table-column prop="qzreview" align="center" width="130">
          <template slot-scope="scope" slot="header">
            <div style="line-height: 20px;">期中考试</div>
            <div style="line-height: 20px;">(已录/已审)</div>
          </template>
        </el-table-column>
        <el-table-column prop="kzreview" align="center" width="130">
          <template slot-scope="scope" slot="header">
            <div style="line-height: 20px;">课终考核</div>
            <div style="line-height: 20px;">(已录/已审)</div>
          </template>
        </el-table-column>
      </el-table>
      <!-- <pagination :total="tableData.length > 0 ? tableData[0].tol : ''" @pageChange="pageChange" 
      style="width:auto;margin-top: 15px;float:right;margin-bottom:50px;padding:0"></pagination> -->
      <div class="block" style="margin-bottom: 50px;">
        <el-pagination
          style="width:auto;margin-top: 15px;float:right;margin-bottom:50px;padding:0"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="cuurrentPage"
          :page-sizes="[5, 10, 20, 30,50,100,200]"
          :page-size="5"
          layout="total, sizes, prev, pager, next, jumper"
          :total="tableData.length > 0 ? tableData[0].tol : ''"
        >
        </el-pagination>
      </div>
      <!-- :current-page="currentPage4" -->
    </div>
    <!-- <div class="bottom-block">
      <div class="export-button">
        <img src="../../../assets/assessment/icon-export.png" alt="" />
        <span>导出Excel</span>
      </div>
      <div class="text">授课教员名字后加“*”为课程负责人</div>
    </div> -->
    <el-dialog
      title="导出总评成绩单"
      :visible.sync="showExportReportDialog"
      width="1185px"
      class="manual-entry-containerass"
    >
      <div class="my-form-container" style="width: 100%; height: 100px">
        <el-row>
          <el-col :span="16">
            <div>成绩范围</div>
            <div>
              <el-radio-group v-model="reportTypep">
                <el-radio
                  :label="item.label"
                  v-for="(item, index) in reportTypepss"
                  :key="index"
                  class="large"
                  >{{ item.value }}</el-radio
                >
              </el-radio-group>
            </div>
          </el-col>
        </el-row>
      </div>
      <span slot="footer" class="dialog-footer">
        <button @click="saveover">保存</button>
      </span>
      <!-- <span style="marign:0 auto">
        <el-button type="success" icon="el-icon-download" @click="saveover">保存</el-button>
      </span> -->
    </el-dialog>

    <el-dialog
      title="导出分项成绩单"
      :visible.sync="showExportReportDialogags"
      width="1185px"
      class="manual-entry-containerass"
    >
      <div class="my-form-container" style="width: 100%; height: 195px">
        <el-row>
          <el-col :span="16">
            <div>成绩范围</div>
            <div>
              <el-radio-group v-model="reportTypep">
                <el-radio
                  :label="item.label"
                  v-for="(item, index) in reportTypepss"
                  :key="index"
                  class="large"
                  >{{ item.value }}</el-radio
                >
              </el-radio-group>
            </div>
          </el-col>
        </el-row>
        <el-row style="width: 100%">
          <el-col :span="16">
            <div>成绩类型</div>
            <div>
              <el-radio-group v-model="reportType">
                <el-radio
                  :label="item.label"
                  v-for="(item, index) in reportTypes"
                  :key="index"
                  class="large"
                  >{{ item.value }}</el-radio
                >
              </el-radio-group>
            </div>
          </el-col>
        </el-row>
      </div>
      <span slot="footer" class="dialog-footer">
        <button @click="savefx">保存</button>
      </span>
      <!-- <span>
        <el-button type="success" icon="el-icon-download" @click="savefx">分项</el-button>
      </span> -->
    </el-dialog>
    <el-dialog
      title="按模板导入课程成绩"
      :visible.sync="showInportReportDialog"
      class="import-report-container"
      width="900px"
      @close="closeM"
    >
      <div>
        <span>请选择数据文件：</span>
        <input type="text" v-model="filepath" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;" readonly/>
        <div class="upload-button" style="line-height: 23px;">
          <input type="file" @change="getFile($event)" />
          <span>浏览</span>
          <!-- <el-button type="primary" size="mini" style="width: 62px;height: 28px;position: absolute;top: 0; right: 0;">浏览</el-button> -->
          <!-- <el-button type="primary" size="mini" @click="downLoadExcel" style="margin-left:20px;position: absolute;top: -1px;left: 80%;">下载数据模板文件</el-button> -->
        </div>
        <div @click="downLoadExcel" class="cjrc-button">下载数据模板文件</div>
      </div>
      <span slot="footer" class="dialog-footer">
        <button class="green" @click="submitFile">
          提交
        </button>
        <!-- <el-button @click="submitFile" size="mini" type="success">
          提交
        </el-button> -->
      </span>
    </el-dialog>
  </div>
</template>

<script>
// import pagination from '@/components/pagination';
import { scoreTeachingAll,scoreTeaAll,scorequery,scoreTjStudentAll } from "@/api/courseAchievement/scoreentry";
import { reqGetXqList,reqCheckLevelList,reqCheckYearList } from "@/api/admin1/check";
import { getxb,getClass,queryXBclassroom,outoverFxrating,outoverallrating,downLoadScoreExcel } from "@/api/course/courses";
import { tjExcelonObject } from "@/api/courseAchievement/printEntry";
// import { queryPostList } from "@/api/courseAchievement/manualEntry";
import { getStore } from '@/util/store.js'

export default {
  data() {
    return {
      pageNo:1,
      pageSize:5,
      planid: "",
      termid: "",
      gClass:"",
      xb:"",
      grade:"",
      eduLevel:"",
      xqList: [],
      xbList:[],
      gClassList:[],
      njList:[],
      levelList:[],
      studytype: "",
      filepath:"",
      xxlxList: [
        {
          value: "必修",
          label: "必修",
        },
        {
          value: "选修",
          label: "选修",
        },
      ],
      tableData: [],
      designcontent: "",
      coursename: "",
      teachingfaculty: "",
      showExportReportDialog: false,
      showExportReportDialogags: false,
      showInportReportDialog: false,
      reportTypep: "按教学班导出",
      reportTypepss: [
        { label: "按教学班导出", value: "按教学班导出" },
        { label: "按课程导出", value: "按课程导出" },
      ],
      reportType: "课下作业",
      reportTypes: [
        { label: "课下作业", value: "课下作业" },
        { label: "课下测评", value: "课下测评" },
        { label: "期中考试", value: "期中考试" },
        { label: "课终考核", value: "课终考核" },
      ],
      subFiles:"",
      roleId: '',
    };
  },
  created() {
    const userInfo = getStore({
      name: "userInfo",
      debug: true,
    }) || {}
    this.roleId = userInfo.content.role_id
  },
  mounted() {
    this.termAll();
    if(this.roleId != '1490880469703041025'){
      this.xbAll();
      this.classAll();
    }
    this.getLevelList();
    this.reqCheckYearList();
    this.scorequery();
  },
  methods: {
    /* pageChange(item) {
      this.pageNo = item.pageNo;
      this.pageSize = item.pageSize;
      this.scorequery();
    }, */
    handleCurrentChange(val) {
      this.pageNo = val;
      this.scorequery();
    },
    handleSizeChange(val) {
      this.pageSize = val;
      this.scorequery();
    },
    closeM(){
      this.filepath = '';
    },
    // 获取学期
    async termAll() {
      const result = await reqGetXqList();
      if (result.data.code == 200) {
        this.xqList = result.data.data;
      }
    },
    async xbAll(){
      const xb = await getxb();
      xb.data.code == 200 ? this.xbList = xb.data.data : [];
    },
    async classAll(){
      const gClass = await getClass();
      gClass.data.code == 200 ? this.gClassList = gClass.data.data : [];
    },
    // 获取培养层次下拉框
    async getLevelList() {
      const result = await reqCheckLevelList('pylevel');
      result.data.code == 200 ? this.levelList = result.data.data[0].children : [];
    },
    // 根据系部选中获取教研室
    async handleXb(val){
      if(val){
        const xbClass = await queryXBclassroom(val);
        xbClass.data.code == 200 ? this.gClassList = xbClass.data.data : [];
        this.gClass = ''
      } else {
        this.xbAll();
        this.classAll();
      }
    },
    // 教研室下拉框的改变
    handleClass(val){
      if(!val){
        this.xb ? this.handleXb(this.xb)  : this.classAll();
      }
    },
    //获取年级下拉框
    reqCheckYearList(){
      let that = this;
      reqCheckYearList().then(res => {
        if(res.data.code == 200 && res.data.data){
          that.njList = res.data.data;
          // that.grade = res.data.data[0].xqszxn;
        }
      });
    },
    handleSelectionChange(val) {
      //定义一个临时数组
      for (var i = 0; i < val.length; i++) {
        //循环遍历当前数组
        //判断当前数组下标为i的元素是否已经保存到临时数组
        //如果已保存，则跳过，否则将此元素保存到临时数组中
        if (this.planidArr.indexOf(val[i].planid) == -1) {
          this.planidArr.push(val[i].planid);
        }
      }
    },
    /* scorequeryPage(){
      this.pageNo = 1;
      this.scorequery();
    }, */
    //按条件查询
    scorequery() {
      let obj = {
        termid: this.termid,
        traininglevel: this.eduLevel,
        studytype: this.studytype,
        coursename: this.coursename,
        designcontent: this.designcontent,
        teachingfaculty: this.teachingfaculty,
        grade: this.grade,
        department:this.xb,
        teachingandresearchsection:this.gClass,
        pageNo:this.pageNo,
        pageSize:this.pageSize
      };
      if(this.roleId === '1490859421955674114'){
        return new Promise(() => {
          scorequery(obj).then((res) => {
            this.tableData = res.data.data;
            this.pageNo = 1;
          });
        });
      } else if(this.roleId === '1490880658945843202'){
        return new Promise(() => {
          scoreTeachingAll(obj).then((res) => {
            this.tableData = res.data.data;
          });
        });
      } else if(this.roleId === '1490880469703041025'){
        return new Promise(() => {
          scoreTjStudentAll(obj).then((res) => {
            this.tableData = res.data.data;
          });
        });
      } else if(this.roleId === '1475294432243830786'){
        return new Promise(() => {
          scoreTeaAll(obj).then((res) => {
            this.tableData = res.data.data;
          });
        });
      }
    },
    //分项
    save(index) {
      this.showExportReportDialogags = true;
      this.reportIndex = index;
    },
    //分项成绩单打印
    savefx() {
      // let el = this;
      let fx = this.reportType; //成绩类型:
      if (this.reportTypep == "按教学班导出") {
        let classesid1 = this.tableData[this.reportIndex].classesid;
        let planid1 = '';
        outoverFxrating(classesid1,fx,planid1).then(res=>{
          // if("success" === res.data.data.code) {
          //   this.showExportReportDialogags = false;
          //   this.showExportReportDialog = false;
          //   const downloadURL = window.location.origin + `/api/xpaas-course-service/testscorequery/outoverFxrating?classid1=${classesid1}&fx=${fx}&planid1=${planid1}`;
          //   window.open(downloadURL, '_blank');
          // } else {
          //   this.$message({ type: "error", message: res.data.data.msg });
          //   this.showExportReportDialogags = true;
          //   this.showExportReportDialog = false;
          // }
          if(res.data.data) {
            this.$message({ type: "error", message: res.data.data });
            this.showExportReportDialogags = false;
            this.showExportReportDialog = false;
          } else {
            this.showExportReportDialogags = false;
            this.showExportReportDialog = false;
            const blob = new Blob([res.data]);
            let url = URL.createObjectURL(blob);
            /** 模拟浏览器操作Document，并模拟下载动作 */
            let link = document.createElement("a");
            link.style.display = "none";
            link.href = url;
            link.setAttribute("download", "按教学班导出分项成绩单.doc");
            document.body.appendChild(link);
            link.click();
          }
        })
      } else if (this.reportTypep == "按课程导出"){
        let planid1 = this.tableData[this.reportIndex].planid;
        let classesid1 = '';
        outoverFxrating(classesid1,fx,planid1).then(res=>{
          // if("success" === res.data.data.code) {
          //   this.showExportReportDialogags = false;
          //   this.showExportReportDialog = false;
          //   const downloadURL = window.location.origin + `/api/xpaas-course-service/testscorequery/outoverFxrating?classid1=${classesid1}&fx=${fx}&planid1=${planid1}`;
          //   window.open(downloadURL, '_blank');
          // } else {
          //   this.$message({ type: "error", message: res.data.data.msg });
          //   this.showExportReportDialogags = true;
          //   this.showExportReportDialog = false;
          // }
          if(res.data.data) {
            this.$message({ type: "error", message: res.data.data });
            this.showExportReportDialogags = false;
            this.showExportReportDialog = false;
          } else {
            this.showExportReportDialogags = false;
            this.showExportReportDialog = false;
            const blob = new Blob([res.data]);
            let url = URL.createObjectURL(blob);
            /** 模拟浏览器操作Document，并模拟下载动作 */
            let link = document.createElement("a");
            link.style.display = "none";
            link.href = url;
            link.setAttribute("download", "按课程导出分项成绩单.doc");
            document.body.appendChild(link);
            link.click();
          }
        })
      }
    },
    //下载模板文件
    downLoadExcel() {
      let el = this;
      let planid = this.tableData[this.reportIndex].planid;
      return new Promise(() => {
        downLoadScoreExcel(planid).then((res) => {
          if(res.data == ''){
            el.$message({
              showClose: true,
              message: "当前课程没有可录入的成绩！",
              type: "error",
            });
          } else {
            const blob = new Blob([res.data]);
            let url = URL.createObjectURL(blob);
            /** 模拟浏览器操作Document，并模拟下载动作 */
            let link = document.createElement("a");
            link.style.display = "none";
            link.href = url;
            link.setAttribute("download", "下载数据模板.xlsx");
            document.body.appendChild(link);
            link.click();
            // let href = `http://192.168.1.114:4444/scorequery/downLoadExcel?planid=${planid}`;
            // // el.$message({
            // //   showClose: true,
            // //   message: "下载中，请稍后",
            // //   type: "success",
            // // });
            // window.open(href, '_blank');
          }
        });
      });
    },
    //总评
    savezong(index) {
      this.showExportReportDialog = true;
      this.reportIndex = index;
    },
    //总评成绩单打印
    saveover() {
      // let el = this;
      let fx = this.reportType; //成绩类型:
      if (this.reportTypep == "按教学班导出") {
        let classesid1 = this.tableData[this.reportIndex].classesid;
        let planid1 = '';
        outoverallrating(classesid1,planid1).then(res=>{
          // if("success" === res.data.data.code) {
          //   this.showExportReportDialogags = false;
          //   this.showExportReportDialog = false;
          //   const downloadURL = window.location.origin + `/api/xpaas-course-service/testscorequery/outoverallrating?classid1=${classesid1}&planid1=${planid1}`;
          //   window.open(downloadURL, '_blank');
          // } else {
          //   this.$message({ type: "error", message: res.data.data.msg });
          //   this.showExportReportDialogags = false;
          //   this.showExportReportDialog = false;
          // }
          if(res.data.type == 'application/json') {
            this.$message({ type: "error", message: '所选课程为没有审核完成的成绩' });
            this.showExportReportDialogags = false;
            this.showExportReportDialog = false;
          } else {
            this.showExportReportDialogags = false;
            this.showExportReportDialog = false;
            const blob = new Blob([res.data]);
            let url = URL.createObjectURL(blob);
            /** 模拟浏览器操作Document，并模拟下载动作 */
            let link = document.createElement("a");
            link.style.display = "none";
            link.href = url;
            link.setAttribute("download", "按教学班导出总评成绩单.zip");
            document.body.appendChild(link);
            link.click();
          }
        })
      } else {
        let planid1 = this.tableData[this.reportIndex].planid;
        let classesid1 = '';
        outoverallrating(classesid1,planid1).then(res=>{
          if(res.data.type == 'application/json') {
            this.$message({ type: "error", message: '所选课程为没有审核完成的成绩' });
            this.showExportReportDialogags = false;
            this.showExportReportDialog = false;
          } else {
            this.showExportReportDialogags = false;
            this.showExportReportDialog = false;
            const blob = new Blob([res.data]);
            let url = URL.createObjectURL(blob);
            /** 模拟浏览器操作Document，并模拟下载动作 */
            let link = document.createElement("a");
            link.style.display = "none";
            link.href = url;
            link.setAttribute("download", "按课程导出总评成绩单.zip");
            document.body.appendChild(link);
            link.click();
          }
          // if("success" === res.data.data.code) {
          //   this.showExportReportDialogags = false;
          //   this.showExportReportDialog = false;
          //   const downloadURL = window.location.origin + `/api/xpaas-course-service/testscorequery/outoverallrating?classid1=${classesid1}&planid1=${planid1}`;
          //   window.open(downloadURL, '_blank');
          // } else {
          //   this.$message({ type: "error", message: res.data.data.msg });
          //   this.showExportReportDialogags = false;
          //   this.showExportReportDialog = false;
          // }
        })
      }
    },
    // saveover(th) {
    //   let obj = [th];
    //   return new Promise(() => {
    //     saveover(obj).then((res) => {
    //       this.tableData = res.data.data;
    //       this.getList();
    //     });
    //   });
    // },
    //模板导入
    lucjClick(index) {
      this.showInportReportDialog = true;
      this.reportIndex = index;
    },
    getFile(event) {
      this.subFiles = event.target.files;
      if(this.subFiles.length > 0){
        this.filepath = this.subFiles[0].name;
      }
    },
    submitFile(){
      let planid = this.tableData[this.reportIndex].planid;
      let form = new FormData();
      form.append("file", this.subFiles[0]);
      form.append("planid", planid);
      // return
      return new Promise(() => {
        tjExcelonObject(form).then((res) => {
          if (res.data.code === 200 && res.data.data == -1) {
            this.$message({
              showClose: true,
              message: "文件上传成功",
              type: "success",
            });
            this.showInportReportDialog = false;
          } else {
            this.filepath = "";
            this.$message({
              showClose: true,
              message: "上传失败，请重新上传!",
              type: "error",
            });
          }
        });
      });
    },
    getList: function () {
      return new Promise(() => {
        getList().then((res) => {
          this.tableData = res.data.data;
        });
      });
    },
    //录入补缓考成绩
    toMakeScore() {
      this.$router.push("/admin/scoreManagement/delayTest");
    },
    //录入第二次补缓考成绩
    toMakeTwoScore() {
      this.$router.push("/admin/scoreManagement/delayTestes");
    },
    //手动录入
    toMakeupScoreEntry(planid) {
      this.$router.push({
        path: "/admin/scoreManagement/manually",
        query: { planid: planid },
      });
    },
    /* toManualEntry() {
      this.$router.push("/admin/testa/manualEntrybcc");
    }, */
  },
};
</script>
<style lang="less" scoped>
.cjrc-button {
  position: absolute;
  width: 130px;
  text-align: center;
  height: 28px;
  line-height: 25px;
  font-size: 13px !important;
  background: #efebff;
  border: 1px solid #5230e9;
  border-radius: 4px;
  color: #5230e9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.assessment-container {
  // width: 100% !important;
  .search-container{
    padding-left: 0 !important;
  }
  .export-report-container {
    .el-dialog__body {
      padding: 64px 0 64px 50px;
      .el-radio {
        margin-right: 79px;
      }
    }
    .el-dialog__footer {
      padding-bottom: 103px;
    }
  }
  .import-report-container {
    .el-dialog__body {
      padding-left: 165px;
      padding-top: 71px;
      padding-bottom: 60px;
      > div {
        > span {
          font-size: 18px;
          font-weight: bold;
          line-height: 20px;
          color: #004ca7;
          vertical-align: middle;
        }
        > input {
          width: 254px;
          height: 25px;
          border: 1px solid #004ca7;
          opacity: 1;
          border-radius: 4px;
          padding-left: 5px;
          margin-right: 8px;
          color: #004ca7;
          vertical-align: middle;
        }
        > div {
          display: inline-block;
          font-size: 18px;
          padding: 1px 10px;
          border-radius: 4px;
          vertical-align: middle;
          cursor: pointer;
          &:nth-child(3) {
            color: rgba(2, 200, 108, 1);
            background: #f1fff8;
            border: 1px solid #02c86c;
            position: relative;
            margin-right: 20px;
            > input {
              width: 0px;
              position: absolute;
              left: 0;
              opacity: 1;
              cursor: pointer;
            }
          }
          &:nth-child(4) {
            color: rgba(82, 48, 233, 1);
            background: rgba(235, 230, 255, 1);
            border: 1px solid rgba(82, 48, 233, 1);
          }
        }
      }
    }
    .el-dialog__footer {
      padding-bottom: 76px;
      .green {
        padding: 1px 17px;
      }
    }
  }
  .manual-entry-container {
    .el-dialog__body {
      > div {
        width: 1014px;
        border: 1px solid rgba(0, 76, 167, 0.8);
        border-radius: 6px;
        margin: 0 auto;
        > div {
          border-bottom: 1px solid rgba(0, 76, 167, 0.39);
          &:last-child {
            border-bottom: none;
          }
          > div {
            display: flex;
            > div {
              height: 96px;
              display: flex;
              align-items: center;
              justify-content: center;
              &:nth-child(1) {
                width: 420px;
                text-align: center;
                font-size: 16px;
                font-weight: bold;
                color: #004ca7;
                background: rgba(77, 129, 192, 0.1);
              }
              &:nth-child(2) {
                padding-left: 19px;
              }
            }
          }
        }
      }
    }
    .el-dialog__footer {
      padding-bottom: 43px;
    }
    .dialog-footer {
      > button {
        width: 87px;
        height: 36px;
        background: #fff6ef;
        border: 1px solid #f3b815;
        border-radius: 6px;
        background: rgba(255, 246, 239, 1);
        font-size: 18px;
        color: #f3b815;
      }
    }
  }
  .manual-entry-containerass {
    .el-dialog__body {
      > div {
        width: 1014px;
        border: 1px solid rgba(0, 76, 167, 0.8);
        border-radius: 6px;
        margin: 0 auto;
        > div {
          border-bottom: 1px solid rgba(0, 76, 167, 0.39);
          &:last-child {
            border-bottom: none;
          }
          > div {
            display: flex;
            > div {
              width: 900px;
              height: 96px;
              display: flex;
              align-items: center;
              justify-content: center;
              &:nth-child(1) {
                width: 420px;
                text-align: center;
                font-size: 16px;
                font-weight: bold;
                color: #004ca7;
                background: rgba(77, 129, 192, 0.1);
              }
              &:nth-child(2) {
                padding-left: 19px;
              }
            }
          }
        }
      }
    }
    .el-dialog__footer {
      padding-bottom: 43px;
    }
    .dialog-footer {
      > button {
        width: 87px;
        height: 36px;
        background: #fff6ef;
        border: 1px solid #f3b815;
        border-radius: 6px;
        background: rgba(255, 246, 239, 1);
        font-size: 18px;
        color: #f3b815;
      }
    }
  }
}
.plan-entry-table-container {
  margin-top: 15px;
  .el-table td,
  .el-table th.is-leaf,
  .el-table--border,
  .el-table--group {
    border-color: #c7d7eb;
  }
  .el-table__header tr,
  .el-table__header th {
    padding: 0;
    height: 76px;
    background-color: #edf2f9;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    line-height: 20px;
    color: #004ca7;
  }
  .el-table__body tr,
  .el-table__body td {
    padding: 0;
    height: 86px;
  }
  .el-checkbox__inner:hover {
    border-color: #004ca7;
  }
  .el-checkbox__inner {
    border: 1px solid #004ca7;
    border-radius: 0;
  }
  .el-checkbox__input.is-checked .el-checkbox__inner,
  .el-checkbox__input.is-indeterminate .el-checkbox__inner {
    background-color: #004ca7;
    border-color: #004ca7;
  }
  .el-checkbox__input.is-checked + .el-checkbox__label {
    color: #004ca7;
  }
  .el-checkbox.is-bordered.is-checked {
    border-color: #004ca7;
  }
  .el-checkbox__input.is-focus .el-checkbox__inner {
    border-color: #004ca7;
  }
  .export-button {
    background: #fff6ef;
    border: 1px solid #f3b815;
    width: auto;
    height: 28px;
    line-height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    box-sizing: border-box;
    > span {
      font-size: 16px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #f3b815;
    }
    > img {
      width: 16px;
      height: 16px;
      margin-right: 5px;
    }
  }

  .lucj-import-button {
    .export-button;
    width: 116px;
    margin: 0 auto 12px;
    background: #f1fff8;
    border: 1px solid #02c86c;
    &:last-child {
      margin-bottom: 0px;
    }
    > span {
      color: #02c86c;
    }
  }
  .lucj-expot-button {
    .export-button;
    background: #fff6ef;
    border: 1px solid #f3b815;
    width: 81px;
    margin: 0 auto 12px;
    &:last-child {
      margin-bottom: 0px;
    }
    > span {
      color: #f3b815;
    }
  }
}
</style>

<style lang="less" scoped>
@import "../../../styles/print-entry.less";
.plan-entry-table-container {
  margin-top: 15px;
  .table-data {
    width: 100%;
    border: 0.8px solid #004ca7;
    border-radius: 9px;
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #004ca7;
  }
}
  /deep/.import-report-container {
    height: 500px;
    .el-dialog__body {
      width: 65%;
      margin: 50px 14%;
      padding-left: 165px;
      padding-top: 71px;
      padding-bottom: 60px;
      > div {
        > span {
          font-size: 18px;
          font-weight: bold;
          line-height: 20px;
          color: #004ca7;
          vertical-align: middle;
        }
        > input {
          width: 254px;
          height: 25px;
          border: 1px solid #004ca7;
          opacity: 1;
          border-radius: 4px;
          padding-left: 5px;
          margin-right: 8px;
          color: #004ca7;
          vertical-align: middle;
        }
        > div {
          display: inline-block;
          font-size: 18px;
          padding: 1px 10px;
          border-radius: 4px;
          vertical-align: middle;
          cursor: pointer;
          &:nth-child(3) {
            color: #FFF;
            background-color: #409EFF;
            border-color: #409EFF;
            position: relative;
            margin-right: 20px;
            font-size: 12px;
            > input {
              width: 0px;
              position: absolute;
              left: 0;
              opacity: 1;
              cursor: pointer;
            }
          }
          &:nth-child(4) {
            color: rgba(82, 48, 233, 1);
            background: rgba(235, 230, 255, 1);
            border: 1px solid rgba(82, 48, 233, 1);
          }
        }
      }
    }
    .el-dialog__footer {
      padding-bottom: 76px;
      .green {
        padding: 1px 17px;
      }
    }
  }
.import-button{
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    padding: 3px 10px;
    -webkit-box-sizing: border-box;
    margin-right: 15px;
    background: #fef1e8;
    border: 1px solid #f86900;
    color: #f86900;
    img {
      width: 17px;
      height: 17px;
      margin-right: 5px;
    }
}
.upload-button {
  width: 62px;
  height: 28px;
  line-height: 28px;
  background: #efebff;
  border: 1px solid #5230e9;
  border-radius: 4px;
  font-size: 13px !important;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: #5230e9;
  text-align: center;
  cursor: pointer;
  position: relative;

  input {
    width: 62px !important;
    position: absolute !important;
    top: 0;
    right: 0;
    opacity: 0 !important;
    cursor: pointer !important;
  }
}

@fontFamily:"Microsoft YaHei";
.xpaas-table-class {
  border: 1px solid #004ca7;
  border-radius: 9px;
  > ::v-deep div.el-table__header-wrapper {
    > table.el-table__header {
      > thead {
        > tr.xpaas-header-row-class {
          padding: 0;
          height: 76px;
          background-color: #edf2f9;
          font-size: 16px;
          font-family: Microsoft YaHei;
          font-weight: bold;
          line-height: 20px;
          color: #004ca7;
          > th.xpaas-header-cell-class {
            font-weight: bold;
            border-right: 1px solid #c7d7eb;
            border-left: 0;
            border-bottom: 1px solid #c7d7eb;
            background-color: #edf2f9;
            > div.cell {
              font-size: 16px;
              font-weight: bold;
              font-family: @fontFamily;
              color: #004ca7;
            }
          }
        }
      }
    }
  }
  > ::v-deep div.el-table__body-wrapper {
    > table.el-table__body {
      > tbody {
        > tr.xpaas-row-class {
          > td.xpaas-header-cell-class {
            border-right: 1px solid #c7d7eb;
            border-left: 0;
            border-bottom: 1px solid #c7d7eb;
            background-color: #edf2f9;
            > div.cell {
              font-size: 16px;
              font-weight: bold;
              font-family: @fontFamily;
              color: #004ca7;
            }
          }
          > td.xpaas-cell-class {
            height: 76px;
            
            border-right: 1px solid #c7d7eb;
            border-left: 0;
            border-bottom: 1px solid #c7d7eb;
            > div.cell {
              font-weight: normal;
              font-family: @fontFamily;
              color: #004ca7;
            }
          }
        }
      }
    }
  }
}
</style>
